﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace YangtzeFilterTestSystem
{
    public partial class LeakBlockPointForm : Form
    {
        public LeakBlockPointForm()
        {
            InitializeComponent();
        }

        protected override void OnPaint(PaintEventArgs e)
        {
            Graphics g = e.Graphics;
            g.DrawImage(GlobalVariables.bkLeakBitmap, 10, 10);  //指定bkBitmap在整个Form上的位置，X，Y为图像在Form左上角的起始位置          
            base.OnPaint(e);
        }

        private void SaveImageBtn_Click(object sender, EventArgs e)
        {
            string str;
            SaveFileDialog sfdlg = new SaveFileDialog();
            sfdlg.Filter = "PNG文件(*.PNG)|*.PNG|All File(*.*)|*.*";

            string strTime = DateTime.Now.Hour.ToString() + "H" + DateTime.Now.Minute.ToString() + "M" + DateTime.Now.Second.ToString() + "S";
            sfdlg.FileName = "TestResult--LeakBlocks--" + strTime + ".png";

            sfdlg.ShowDialog();

            str = sfdlg.FileName;
            GlobalVariables.bkLeakBitmap.Save(str);
        }
    }
}
